package sistemioperativi.prodcons.sample;
import java.util.*;


public abstract class BufferList {
	
	protected LinkedList<Elemento> coda;
	
	public BufferList(){
		this.coda = new LinkedList<Elemento>();
	}
	
	public abstract void put (Elemento e) throws InterruptedException;
	
	public abstract Elemento get() throws InterruptedException;
	
	public void test(int numProduttori, int numConsumatori){
		
		for(int i = 0; i < numProduttori; i++){
			new Thread(new ProduttoreIllimitato(this)).start();
		}
		
		for(int i = 0 ; i < numConsumatori; i++){
			new Thread(new ConsumatoreIllimitato(this)).start();
		}
	
	}	
}// EOC
